/*
** my_strcapitalize.c for  in /home/gueux_g/piscine/Jour_06
**
** Made by gregory gueux
** Login   <gueux_g@epitech.net>
**
** Started on  Tue Oct  9 03:15:54 2012 gregory gueux
** Last update Thu Oct 11 20:36:55 2012 gregory gueux
*/

char	*my_strcapitalize(char *str)
{
  int	i;

  i = 0;
  while (str[i])
    {
      if (str[i] >=  'a' && str[i] <= 'z' && i == 0)
	str[i] = str[i] - 'a' + 'A';
      else if ((str[i] >= 'a' && str[i] <= 'z') &&
	       (str[i - 1] < 'A' || str[i - 1] > 'z'))
	{
	  if (str[i - 1] >= '0' && str[i - 1] <= '9')
	      str[i] = str[i];
	  else
	    str[i] = str[i] - 'a' + 'A';
	}
      i = i + 1;
    }
  return (str);
}
